<?php

/**
 * Notification class
 *
 * @author Julot <andy.julot@gmail.com>
 * @since Monday, August 8, 2011. 10:40 AM
 */
class NotificationMailMessage extends MailMessage {

	/**
	 * @param string $subject
	 * @param string $body
	 */
	public function __construct($subject=null, $body=null) {
		parent::__construct($subject, $body);

		$notification = Yii::app()->params['notification'];
		foreach ($notification['recipients'] as $recipient) {
			$this->addTo($recipient['email'], $recipient['name']);
		}

		$address = $notification['sender']['email'];
		$this->setFrom($address, $notification['sender']['name']);
	}

}
